import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class BotonMenuu here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class BotonMenuu extends Actor
{
    /**
     * Act - do whatever the BotonMenuu wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
        // Add your action code here.
        selecionado();
    }   

    /**
     * Pinta el Menú
     */
    public void selecionado()
    {
        //if(UserInfo.isStorageAvailable())
        //{
            UserInfo info=UserInfo.getMyInfo();
            if(info!=null)
            {
                if(((Room1_1)getWorld()).getNivel() > info.getScore())
                {
                    info.setScore(((Room1_1)getWorld()).getNivel()); //AQUI VAN LOS NIVELES QUE GANÓ EL USUARIO
                    info.store();
                }
            }
        //}

        if(Greenfoot.mouseClicked(this))
            Greenfoot.setWorld(new Menu());
    }  
}
